<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<title>动态详情</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui-win.css" />
<style>
*{
	font-indent:0pt;
}
body {
	width: 100%;
	margin: 0;
	padding: 0;
}
#txtNewsList {
	width: 90%;
	margin-left: 5%;
}
#time {
	margin: 0 !important;
	font-size: 14px;
	color: gray;
}
#content {
	
	width: 100%;
	overflow: hidden;
	color:#333;		
	line-height:22px;
}
#content p{
	font-size: 14px !important;
}
#content p span{
	background:none !important;
}
#content img {
	width: 100%;
}
#enter {
	width: 100%;
	margin: 10 auto;
}
#enter a {
	line-height: 35px;
	text-align: center;
	display: block;
	height: 35px;
	width: 90%;
	font-size: 1em;
	margin-left: 5%;
	color: rgba(255,255,255,1);
	border: 1px solid rgba(0,0,0,0.2);
	background-color: #00ABFD;
	border-radius: 5px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
}
#enter {
	text-align: center;
	margin-top: 10px;
	margin-bottom:10px;
	float:left;
}
.foot {
	z-index: 50;
	width: 100%;
	height: 80px;
	bottom: 0px;
	padding-top: 10px;
	position: fixed;
	background: white;
	border-top:1px solid #ccc;
}
.icon {
	width: 12px;
	height: 12px;
	margin-left: 5%;
}
.bracket {
	width: 100px;
}
#loading{
position:absolute;
width:300px;
top:100px;
left:50%;
margin-left:-150px;
text-align:center;
padding:7px 0 0 0;
font:bold 11px Arial, Helvetica, sans-serif;
}
#txtNewsList .MsoNormal{
	text-indent:0pt !important;
}
#comments{
	color:#00abfd;
	float:right;
	width:49%;
	border-left:1px solid #ccc;
	text-align:center;
	font-size:15px;
}
#zan{
	color:#00abfd;
	float:left;
	width:50%;
	border-left:1px solid #ccc;
	text-align:center;
	font-size:15px;
}
#chengkai{
width:100%;
	height:50px;
}
</style>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../script/jquery-1.10.2.min.js"></script>
<script src="../../script/common.js"></script>
<script type="text/javascript">
$(window).load(function(){
    $("#loading").hide();
});
</script>
</head>
<body>
    <div class="div_loding_img">
		数据加载中
	</div>
	<header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back" > <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			动态详情
		</div>
		<a class="aui-iconfont aui-icon-menu aui-pull-right"><i class="fa fa-share-alt"></i></a>
	</header>
	
	<div class="margin_div"></div>
	<div id="txtNewsList">
		<div id="yunzo-bg" class="content">
			<h3 id="titles" style="font-weight:bold;font-size:18px;"></h3>
			<p id="time"></p>
			<div id="content"></div>
		</div>
	</div>
	<div id="chengkai"></div>
	<div class="foot" id="foot"></div>	
<script type="text/javascript">

var baseDatas;
var postparam;
var did;
var $titles;
var $time;
var $content;
var $foot;
 $("#back").click(function(){
             goback("dync_list.html");
        });
$(document).ready(function(){
	$titles = $('#titles');
	$time = $('#time');
	$content = $('#content');
	$foot = $('#foot');

	
	baseDatas=basedata('dyncinfo');
	did=initdata.get('dyncinfo');
	
	postparam =baseDatas+"&dynid="+getUrlParam("infoid");
    loadaction(postparam);
});
//点赞

function loadaction(param)
{	$(".div_loding_img").css("display","block")
	ajaxcocRequest('../../../api/group/getgroupdynamicinfoObject', 'post', param, function(msg){
        if(msg.code==100){
			var html1 ='';
			var thisItem = msg.datum;
			var zanSrc = "";
			if (thisItem.n7 == 0) {
				zanSrc = "../../image/home/busess/nozan.png"
			} else {
				zanSrc = "../../image/home/busess/zan.png"
			}
			$titles.html(thisItem.n2);
			$time.html(thisItem.n4);
			$content.html(thisItem.n3.replace(/&nbsp;/g, ""));
			
			html1 += '<a id="zan" onclick="thumbUp(\'' + thisItem.n0 + '\',' + thisItem.n7 + ')"><img class="icon" src="' + zanSrc + '" > 赞(<span id="zan_">' + thisItem.n6 + '</span>)</a>';
			html1 += '<a id="comments" onclick="openNews(\'' + thisItem.n0 + '\',' + did + ')"><img class="icon" src="../../image/home/busess/pinglun.png"> 评论<span class="bracket">(<span id="comment">' + thisItem.n5 + '</span>)</span></a>';
			html1 += '<div id="enter"><a onclick="applyGroup()">申请加入商会</a></div>'
			$foot.html('');
			$(".div_loding_img").css("display","none")
			$foot.html(html1);
			$("#txtNewsList img").attr("onerror","javascript:this.src='../../image/defaultImg2.png'");
			if($mtype=="guest"){
				$("#enter").css("display","block");
				
			}
			else{
				$("#enter").css("display","none");
				$("#foot").height(35)
			}
        }
        else{
        	$(".div_loding_img").css("display","none")
        	$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
        }
    });
}
function thumbUp(bid, type) {
	$(".div_loding_img").css("display","block")
	ajaxcocRequest('../../../api/userproetformid', 'POST', baseDatas + '&type='+(type==0?1:0)+'&pid=' + bid, function(msg) {
		if (msg.code==100) {
			//详情展示
			loadaction(postparam);
			alert(type==0?"取消点赞！":"点赞成功！");
			$(".div_loding_img").css("display","none")
		} else {
			$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
			$(".div_loding_img").css("display","none")
		}
	})
	
}
function applyGroup()
{
	window.location="attendGroup.html";
}
//评论
function openNews(pid,did){
if($mtype=="guest")
		{
			alert("游客模式无权限使用[评论]功能！");
			
		}else{
	var localData =  window.localStorage;
	
	window.location ="comment_info.html?pid="+pid+"&did="+did+"&path=dync_info.html";
	}
} 

</script>

</body>
</html>